<?php

namespace app\admin\model;

use think\Model;


class Vip extends Model
{

    

    

    // 表名
    protected $name = 'vip';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getGratiCategoryIdsAttr($value, $data)
    {   
        $value = explode(',',$value);
        return $value;
    }

    public function setGratiCategoryIdsAttr($value, $data)
    {   
        $value = implode(',',$value);
        return $value;
    }


    public function Category()
    {
        return $this->belongsTo('app\common\model\Category', 'type', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function Category1()
    {
        return $this->belongsTo('app\admin\model\litestore\Litestorecategory', 'service_category_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

}
